package com.inxedu.os.edu.pojo;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

public class InxeduResult implements Serializable {
    private boolean success;
    private String message;
    private Object entity;

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getEntity() {
        return entity;
    }

    public void setEntity(Object entity) {
        this.entity = entity;
    }

    public InxeduResult() {
        super();
    }

    public InxeduResult(boolean success, String message) {
        this.success=success;
        this.message=message;
    }
    public InxeduResult(String message) {
        this.message=message;
    }

    public InxeduResult ok(boolean success, String message){
        return new InxeduResult(success,message);
    }
    public InxeduResult ok1(String message){
        return new InxeduResult(message);
    }
    public Map<String,Object> ok2(String message){
        Map<String,Object> map=new HashMap<>();
        map.put("message",message);
        return map;
    }
    @Override
    public String toString() {
        return "InxeduResult{" +
                "success=" + success +
                ", message='" + message + '\'' +
                ", entity=" + entity +
                '}';
    }
}
